package com.rttmall.shopbackend.enums;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang.StringUtils;
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum CountryCode {
	TT("TT", "Trinidad and Tobago"),
	
	SR("SR", "Suriname"),
    ;

    private String code;

    private String text;

    public void setCode(String code) {
		this.code = code;
	}
	public void setText(String text) {
		this.text = text;
	}
	CountryCode(String code, String text) {
        this.code = code;
        this.text = text;
    }
    public String getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static CountryCode getEnums(String code) {
        for (CountryCode enums : values()) {
            if (StringUtils.equalsIgnoreCase(code, enums.getCode())) {
                return enums;
            }
        }
        return null;
    }
}
